<template>
  <div class="header">
    <div class="logo">
      <slot></slot>
    </div>
    <div class="search" @click="tosearch">
      <van-search v-model="v1" shape="round" placeholder="请输入搜索关键词" />
    </div>
  </div>
</template>

<script>
export default {
  name: "compHeader",
  data() {
    return {
      v1: "",
    };
  },
  methods:{
    tosearch()
    {
      this.$router.push("/search")
    }
  }
};
</script>
<style lang="scss" scoped>
.header {
  width: 100%;
  height: 50px;
  padding: 0 25px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  .logo {
    img {
      height: 30px;
      margin-right: 10px;
      vertical-align: middle;
    }
  }
  .search {
    flex-grow: 1;
    input{
        height: 100%;
    }
  }
}
</style>